/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.ua.node;

import java.util.ArrayList;
import java.util.List;
import org.xml.sax.Attributes;
import org.xml.sax.helpers.AttributesImpl;

/**
 *
 * @author ananthaamornphong
 */
public class ClassNode extends UMLNode{

    private String name = "";
    private String visibility = "Public";
    
    private List child = new ArrayList(); 
    
    
    
    
    public void setName(String name){
        this.name = name;
    }
    
    public void addFunction(UMLNode node){
        child.add(node);
    }
    
    public void addSubroutine(UMLNode node){
        child.add(node);
    }
    
    public void addUses(UMLNode node){
        child.add(node);
    }
    
    
    @Override
    public String getName() {
       // return this.name;
        return "UML:Class";
    }

    @Override
    public List getChildren() {
        return child;
    }

    @Override
    public int getChildCount() {
        return child.size();
    }

    @Override
    public Attributes getAttributes() {
        AttributesImpl attributes = new AttributesImpl();
        attributes.addAttribute("", "xmi.id", "", "", Long.toString(this.hashCode()));
        attributes.addAttribute("", "name", "", "", this.name);
        attributes.addAttribute("", "visibility", "", "", this.visibility);
        attributes.addAttribute("", "isSpecification", "","", "false");
        attributes.addAttribute("", "isRoot", "","", "false");
        attributes.addAttribute("", "isLeaf", "","", "false");
        attributes.addAttribute("", "isAbstract", "","", "false");
        attributes.addAttribute("", "isActive", "","", "false");
        
         
        return attributes;
    }
    
    
    
}
